public class Solution {
    public static void main(String[] args) {
        int[] arr = {1,2,3,2,5,6};
        bubble(arr);
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i]+" ");
        }
    }
    public static void merge(int[] A, int m, int[] B, int n) {
        //A数组存入B
        for(int i = m; i < m+n; i++) {
            A[i] = B[i-m];
        }
        //进行排序(冒泡)
        bubble(A);
    }
    private static void bubble(int[] arr) {
        for(int i = 0; i < arr.length-1; i++) {
            for(int j =0; j < arr.length-i-1;j++) {
                if(arr[j] > arr[j+1]) {
                    int tmp = arr[j];
                    arr[j] = arr[j+1];
                    arr[j+1] = tmp;
                }
            }
        }
    }
}
